import { defHttp } from '/@/utils/http/axios';
import {  WebsiteExamResultModel, WebsiteExamResultTableRecordModel } from '../model/websiteExamResultModel';
import { ErrorMessageMode } from "/#/axios";

enum Api {
  WEBSITEEXAMRESULT_PAGE = '/jxxhWebsite/websiteExamResult/getExamResultVosPage',
  GET_WEBSITEEXAMRESULTVO_BY_ID = '/jxxhWebsite/websiteExamResult/',
  WEBSITEEXAMRESULTVO_SAVE = '/jxxhWebsite/websiteExamResult/save',
  WEBSITEEXAMRESULTVO_UPDATE = '/jxxhWebsite/websiteExamResult/updateById',
  WEBSITEEXAMRESULTVO_REMOVE = '/jxxhWebsite/websiteExamResult/logicalRemoveById/',
}

/**
 * @description: Get sample list value
 */

export const websiteExamResultListApi = (params: Object) =>
  defHttp.get<WebsiteExamResultTableRecordModel>(
    {url: Api.WEBSITEEXAMRESULT_PAGE,params },
    { errorMessageMode: 'message' }
  );

export const getWebsiteExamResultVoByIdApi = (id) =>
  defHttp.get<WebsiteExamResultModel>(
    {url: Api.GET_WEBSITEEXAMRESULTVO_BY_ID+id },
    { errorMessageMode: 'message' }
  );

export function websiteExamResultSaveApi(params: WebsiteExamResultModel, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<WebsiteExamResultModel>(
    {
      url: Api.WEBSITEEXAMRESULTVO_SAVE,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function websiteExamResultUpdateApi(params: WebsiteExamResultModel, mode: ErrorMessageMode = 'modal') {
  return defHttp.put<WebsiteExamResultModel>(
    {
      url: Api.WEBSITEEXAMRESULTVO_UPDATE,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export const logicalRemoveById = (id) =>
  defHttp.delete<WebsiteExamResultModel>(
    {url: Api.WEBSITEEXAMRESULTVO_REMOVE+id },
    { errorMessageMode: 'message' }
  );
